import { http } from "leisure-lib";
import NProgress from "nprogress";

const request = http({ baseURL: "", NProgress });

const baseUrl = "/api";

export const getPhotosList = (data) => {
  return request.get({
    url: "https://jsonplaceholder.typicode.com/posts",
    data,
  });
};

export const getHello = () => {
  return request.get({
    url: `${baseUrl}`,
  });
};
export const getStatistics = () => {
  return request.get({
    url: `${baseUrl}/statistics/statisticsList`,
  });
};
export const getTeacherList = (params) => {
  return request.get({
    url: `${baseUrl}/teacher/list`,
  });
};
export const getTeacherOne = (params) => {
  return request.get({
    url: `${baseUrl}/teacher/get/${params}`,
  });
};
export const addTeacherOne = (params) => {
  return request.post({
    url: `${baseUrl}/teacher/add`,
    params,
  });
};
export const updateTeacherOne = (params) => {
  return request.post({
    url: `${baseUrl}/teacher/update`,
    params,
  });
};
export const deleteTeacherOne = (params) => {
  return request.delete({
    url: `${baseUrl}/teacher/remove/${params}`,
  });
};
